﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Text;

namespace MiniBug.Controllers
{
    public class TestController : Controller
    {
        //
        // GET: /Test/

        public ActionResult Index()
        {
            return View();
        }

        public string GetInfo()
        {
            StringBuilder info = new StringBuilder();
            info.AppendLine("<br/>");
            info.AppendLine("Server name: " + Server.MachineName);
            info.AppendLine("<br/>");
            info.AppendLine("Browser platform: " + Request.Browser.Platform);
            info.AppendLine("<br/>");
            info.AppendLine("Url: " + Request.Url.AbsoluteUri);
            return info.ToString();
        }

        public ContentResult GetInfoAsXml()
        {
            StringBuilder info = new StringBuilder();
            info.Append( @"<info>
                            <ServerName>"+ Server.MachineName +@"</ServerName>
                            <Browser>" + Request.Browser.Platform + @"</Browser>
                            <Url>" + Request.Url.AbsoluteUri + @"</Url>
                            </info>");

            return Content(info.ToString(), "text/xml");
        }

    }
}
